package org.example.study1;

import java.io.File;

public class PathSeparatorDemo {
    public static void main(String[] args) {
        // 获取系统路径分隔符
        String pathSep = File.pathSeparator;
        char pathSepChar = File.pathSeparatorChar;

        // 获取系统文件分隔符
        String fileSep = File.separator;
        char fileSepChar = File.separatorChar;

        // 打印结果
        System.out.println("路径分隔符 (字符串): " + pathSep);  // Windows: ; Unix: :
        System.out.println("路径分隔符 (字符): " + pathSepChar);
        System.out.println("文件分隔符 (字符串): " + fileSep);   // Windows: \ Unix: /
        System.out.println("文件分隔符 (字符): " + fileSepChar);
    }
}
